<!DOCTYPE html>  
<html xmlns:th="http://www.thymeleaf.org" lang="zh-CN"> 
<head> 
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>设计师信息</title>
	<!-- 常规css -->
    <link th:href="@{bootstrap/css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{font-awesome/css/font-awesome.min.css}" rel="stylesheet" />
    <!-- 项目css -->
    <link th:href="@{css/layout.css}" rel="stylesheet" />
</head> 
<body th:with="asort=${#httpServletRequest.getParameter('sort')}, aorder=${#httpServletRequest.getParameter('order')}, num=${data.num}, pageIndex=${data.pageIndex}">
	<!-- 侧边导航栏 -->
	<div th:replace="aframe::sideNavigation"></div>
	
	<!-- 主页面 -->
	<div class="content" style="padding:0">
		<!-- 顶部导航栏 -->
		<div th:replace="aframe::topNavigation"></div>
		<!-- 内容 -->

		<!-- 标签页内容 -->
		<div role="tabpanel" class="tab-pane active" id="history" style="margin:20px">
			<div class="panel panel-default" >
				<div class="panel-heading">
					<h4>设计师信息&nbsp;&nbsp;
						<span><button class="btn btn-sm btn-success" th:onclick="showAdd()">添加设计师</button></span>
					</h4>
				</div>
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
						<tr>
							<th>编号</th>
							<th>姓名</th>
							<th>照片</th>
							<th>称号</th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						<tr th:each="entity: ${data.list}">
							<th scope="row" th:text="${entity?.designerId}">编号</th>
							<td th:text="${entity?.designerName}">姓名</td>

							<td><button type="button" class="btn btn-default btn-sm" th:text="查看" data-toggle="modal" th:data-target="'#showImgModal'+${entity?.designerId}"></button></td>
							<div class="modal fade text-center" th:id="'showImgModal'+${entity?.designerId}">
								<div class="modal-dialog modal-lg" style="display: inline-block; max-height: 800px; width: auto;">
									<div class="modal-content">
										<img th:src="${entity?.designerPic}" style="max-height: 820px">
									</div>
								</div>
							</div>

							<td th:text="${entity?.designerTitle}">头衔</td>
							<td>
								<button class="btn btn-sm btn-info"  th:onclick="showDetail([[${entity?.designerId}]])">简介</button>
								<button class="btn btn-sm btn-primary"  th:onclick="showEdit([[${entity?.designerId}]])">编辑</button>
								<button class="btn btn-sm btn-danger"  th:onclick="showDelete([[${entity?.designerId}]])">删除</button>
							</td>
						</tr>
						</tbody>
					</table>

					<!-- 分页 -->
					<div th:replace="aframe::pagingBar"></div>

				</div>
			</div>
		</div>
	</div>
		<!-- end 内容 -->
	<!-- end 主页面 -->

	<!-- 模态框: 信息 -->
	<form class="form-horizontal" role="form" id="detailForm" style="margin: 20px;">
		<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="detailModalLabel"> 查看详情 </h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">简介</label>
							<div class="col-sm-7">
								<p class="form-control-static" id="d_designerDesc"></p>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					</div>
				</div>
			</div>
		</div>
	</form>


	<!-- 模态框: 编辑 -->
	<form class="form-horizontal" role="form" id="editForm" style="margin: 20px;">
		<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="editModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="editModalLabel"> 编辑信息 </h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<input type="hidden" name="designerId" id="e_designerId">
							<label class="col-sm-3 control-label">姓名</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="e_designerName" name="designerName" placeholder="请输入设计师姓名">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">称号</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="e_designerTitle" name="designerTitle" placeholder="请输入称号">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">照片</label>
							<div class="col-sm-7">
								<input type="file" class="form-control" id="e_designerPic" name="file" placeholder="请上传设计师照片">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">简介</label>
							<div class="col-sm-7">
								<textarea rows="6" type="text" class="form-control" id="e_designerDesc" name="designerDesc" placeholder="请输入设计师简介"></textarea>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="editButton">确认修改</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 添加 -->
	<form class="form-horizontal" role="form" id="addForm" style="margin: 20px;">
		<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-lg">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="addModalLabel"> 新增设计师 </h4>
					</div>
					<div class="modal-body">
						<div class="form-group">
							<label class="col-sm-3 control-label">姓名</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="a_designerName" name="designerName" placeholder="请输入设计师姓名">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">称号</label>
							<div class="col-sm-7">
								<input type="text" class="form-control" id="a_designerTitle" name="designerTitle" placeholder="请输入称号">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">照片</label>
							<div class="col-sm-7">
								<input type="file" class="form-control" id="a_designerPic" name="file" placeholder="请上传设计师照片">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">简介</label>
							<div class="col-sm-7">
								<textarea rows="6" type="text" class="form-control" id="a_designerDesc" name="designerDesc" placeholder="请输入设计师简介"></textarea>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
						<button type="button" class="btn btn-primary" id="addButton">确认添加</button>
					</div>
				</div>
			</div>
		</div>
	</form>

	<!-- 模态框: 修改密码 -->
	<div th:replace="aframe::modifyPwd"></div>


<!-- 常规js -->
<script th:src="@{js/jquery-3.4.1.min.js}"></script>
<script th:src="@{bootstrap/js/bootstrap.min.js}"></script>
<!-- 模板js -->
<script th:replace="aframe::js-highlight"></script>
<!-- 项目js -->
<script th:src="@{js/md5.js}"></script>
<script th:src="@{js/setpwd.js}"></script>
<!-- 页面js -->
<script th:src="@{js/designer.js}"></script>

</body>
</html> 

